#include <sys/time.h>
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
void catchSig(int num)
{
        printf("cat %d sig\n", num);
}
int main(int argc, char const *argv[])
{
        signal(SIGALRM, catchSig);
        struct itimerval newValue = {{3,0},{5,0}};//第一次等待5s,之后每隔3s
        setitimer(ITIMER_REAL, &newValue, NULL);
        while (1){
                printf("who can kill me!\n");
                sleep(1);       
        }
        return 0;
}